import axios from '../../config/axios'
import {baseURL} from "./env";
/**
 *
 *  请求封装
 *
 */

export default {
    // GET permission参数为是否验证登录
    get(path, data) {
		let url=baseURL+path+"?";
        Object.keys(data).forEach(function (k){
            url += `${k}=${data[k]}`
        })
        return axios({
            url,
            data,
            method: 'GET'
        })
    },
    // POST
    post(path, data, type = 'application/json;charset=UTF-8') {
		let url=baseURL+path;
        return axios({
            url,
            data,
            method: 'POST',
            headers: {
                'Content-type': type
            }
        })
    }

}
